package com.xinqi.modules.prepare.question.manager;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xinqi.common.mybatis.data.service.BaseService;
import com.xinqi.modules.prepare.question.domain.PrepareQuestionFolderEntity;
import com.xinqi.modules.prepare.question.dto.req.PrepareQuestionFolderQueryDTO;
import com.xinqi.modules.prepare.question.dto.rsp.PrepareQuestionFolderResultDTO;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 备课区试题夹管理层
 *
 * @author: system
 * @date: 2023/03/19
 */
public interface PrepareQuestionFolderManager extends BaseService<PrepareQuestionFolderEntity> {

    /**
     * 自定义分页查询
     */
    Page<PrepareQuestionFolderResultDTO> findPage(Page<Object> page, PrepareQuestionFolderQueryDTO query);

    /**
     * 自定义列表查询
     */
    List<PrepareQuestionFolderResultDTO> findList(PrepareQuestionFolderQueryDTO query);

    /**
     * 根据id查询 备课区试题夹数据
     */
    PrepareQuestionFolderEntity findById(Long id);

    /**
     * 根据id删除 备课区试题夹数据
     */
    @Transactional(rollbackFor = Exception.class)
    boolean deleteById(Long id);

    /**
     * 试题夹是否存在
     */
    Boolean isExistName(Long prepareId, String name, Long oldId);
}
